<!doctype html>
<html>
    <head>
        <meta charset="UTF-8"/>
	    <link rel="stylesheet" type="text/css" href="/webapp/css/easyui.css">
	    <link rel="stylesheet" type="text/css" href="/webapp/css/icon.css">
      <link rel="stylesheet" type="text/css" href="/webapp/css/color.css">
      <link rel="stylesheet" type="text/css" href="/webapp/css/public.css">
	    <script type="text/javascript" src="/webapp/js/lib/jquery.min.js"></script>
	    <script type="text/javascript" src="/webapp/js/lib/jquery.easyui.min.js"></script>
	    <script type="text/javascript" src="/webapp/js/lib/ajaxfileupload.js"></script>
	    <script type="text/javascript" src="/webapp/js/common/config.js"></script>
    </head>
    <body class="easyui-layout">
       <div class="easyui-container-fluid">
          <div class="easyui-pannel" style="width:100%;border: none;">
            <div class="nav"></div> 
            <div class="easyui-panel">
                <div style="margin-bottom:20px">
                  <label class="item-label">用户名：</label>
                  <input type="text" class="easyui-textbox" placeholder="用户名" />
                </div>
                <div style="margin-bottom:20px;text-align:center;">
                    <a href="" class="easyui-linkbutton c8" style="width:80px;">查询</a>
                </div>
            </div>
            <div class="table-wrapper">
             <table id="datagrid" class="easyui-datagrid">
               <thead>
                 <tr>
                   <th data-options="field:'username'">用户名</th>
                   <th data-options="field:'department'">部门</th>
                   <th data-options="field:'lastlogintime'">最后登录时间</th>
                   <th data-options="field:'ip'">最后登录IP</th>
                   <th data-options="field:'entityStatus'">状态</th>
                   <th data-options="field:'action',formatter:actions">操作</th>
                 </tr>
               </thead>
               <tbody>
               </tbody>
             </table>
           </div>
          </div> 
       </div>  
    </body>
    <script type="text/javascript">
           $(function(){
               $("#datagrid").datagrid({
                   pagination:true,
                   rownumbers:true,
                   toolbar:[{
                        iconCls:'icon-add',
                        handler:function(){
                          window.parent.addTab("添加用户","../user/add.html");
                        }
                    }]
               });
               $.ajax({
                   url:config.url + "/user/pager",
                   type:"get",
                   xhrFields:{withCredentials:true},
                   success:function(data){
                      $("#datagrid").datagrid({data:data.content}).datagrid("getPager").pagination({
                        pageList:[10,15,20,25,30,35,40,50,100],
                        displayMsg:"共"+data.totalElements+"条记录"
                      });
                   },
                   error:function(data){
                      console.log(data);
                   }
               });

           });
           function actions(){
              return "<a>修改</a><a>禁用</a>";
           }
      </script>
</html>
